﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Compiler
{
    public class Terminal : Symbol
    {
        public Terminal(int ID, string Name)
            : base(ID, Name)
        {
        }

        public class TerminalEqualityComparer : IEqualityComparer<Terminal>
        {
            public bool Equals(Terminal x, Terminal y)
            {
                return ReferenceEquals(x, y) || x.Name == y.Name && x.ID == y.ID && x.GetType() == y.GetType();
            }

            public int GetHashCode(Terminal obj)
            {
                return obj.Name.GetHashCode() + 17 * obj.ID.GetHashCode();
            }
        }
    }
}
